package cn.chencaiju.day08;

import java.util.HashSet;
import java.util.Set;

import org.junit.Test;

public class HashSetTest {
	private Set<String>	setStr=new HashSet<>();
	private Set<Car> setCar=new HashSet<>();
	@Test public void testSetOfString() {
		setStr.add("split");
		setStr.add("refactor");
		setStr.add("inherit");
		setStr.add("inherit");
		for(String s:setStr) {
			System.out.println(s);
		}
	}
	@Test public void testSetOCar() {
		setCar.add(new Car("雪佛兰",4.1f,1.5f));		
		setCar.add(new Car("雪佛兰",4.3f,1.5f));
		setCar.add(new Car("雪佛兰",4.4f,1.5f));
		setCar.add(new Car("雪佛兰",4.1f,1.5f));
		for(Car c:setCar) {
			System.out.println(c);
		}
	}
}
